package com.hcy.asyncfiledownload.datamodule.service.provider;

import com.hcy.asyncfiledownload.common.entry.ExportRecord;

/**
 * @Author huchenying
 * @Date 2022/9/6 16:38
 * @Description 抽象类，为了将共有的逻辑拆出来
 */
public abstract class AbstractExportProvider implements ExportHandler {

    ThreadLocal<ExportRecord> threadLocal = new ThreadLocal<>();

    public void afterProperties(ExportRecord record){
        threadLocal.set(record);
    }

    protected void removeThreadLocal(){
        threadLocal.remove();
    }

    protected ExportRecord getRecord(){
        return threadLocal.get();
    }

}
